package org.jeecg.enums.car;

/**
 * 续费类型 0 正常续费 1：断缴续费
 */
public enum CarChargeTypeEnum {
    CHARGE_TYPE_NORMAL("0", "正常缴费"),
    CHARGE_TYPE_DISC("1", "断缴续费"),
    ;

    private String code;
    private String desc;

    CarChargeTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(String value) {
        if (value == null) return "";
        CarChargeTypeEnum[] enums = values();
        for (CarChargeTypeEnum typeEnum : enums) {
            if (value.equals( typeEnum.getCode())) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static String getValue(String desc) {
        CarChargeTypeEnum[] enums = values();
        for (CarChargeTypeEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }
}
